generalized acceptance withholding algorithm